import { Component } from 'react';
import Context from '../util'
interface Ifun {
  <T>(str:T):{}
}
const connect = (fun1:Ifun,fun2:Ifun)=> (Warpcom:any)=>class Compon extends Component {
  render(){
    return (
      <Context.Consumer>
        {
          (data:any)=>{
            let res1 = fun1(data.store);
            let res2 = fun2(data.dispatch);
            return <Warpcom {...res1} {...this.props} {...res2}/>
          }
        }
      </Context.Consumer>
    )
  }
}
export default connect;